using Newtonsoft.Json;
using System.IO;
using UnityEngine;

public class AssemblyRecorder : MonoBehaviour
{
    public GameObject go;
    public AllStep allStep;

    // Start is called before the first frame update
    void Start()
    {
        PartInfo partInfo = new PartInfo();
        partInfo.modelName = go.name;
        partInfo.SetPosFrom(Vector3.zero);
        partInfo.SetPosTo(new Vector3(1, 2, 3));
        partInfo.SetRotFrom(Vector3.zero);
        partInfo.SetRotTo(new Vector3(900, 1800, 300));
        partInfo.lerpTime = 3;
        StepInfo stepInfo = new StepInfo();
        stepInfo.stepName = "Cubey移动和旋转";
        stepInfo.partInfos.Add(partInfo);

        allStep = new AllStep();
        allStep.stepInfos.Add(stepInfo);
        string json = JsonConvert.SerializeObject(allStep);
        Debug.Log(json);
        File.WriteAllText(Application.streamingAssetsPath + "/test.json", json);
    }

    // Update is called once per frame
    void Update()
    {

    }
}